/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.cgb.portal.bo;

import br.cgb.portal.entity.ActivationCode;
import br.cgb.portal.entity.User;
import br.cgb.portal.facade.ActivationCodeFacade;
import java.io.Serializable;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author LUCAS
 */
@Stateless
public class ActivationCodeBO implements Serializable {

    @EJB
    private ActivationCodeFacade activationCodeFacade;

    public ActivationCodeFacade getActivationCodeFacade() {
        return activationCodeFacade;
    }

    public void create(ActivationCode activationCode) {
        getActivationCodeFacade().create(activationCode);
    }

    public void edit(ActivationCode activationCode) {
        getActivationCodeFacade().edit(activationCode);
    }

    public void remove(ActivationCode activationCode) {
        getActivationCodeFacade().remove(activationCode);
    }

    public ActivationCode find(Object id) {
        return getActivationCodeFacade().find(id);
    }

    public List<ActivationCode> findAll() {
        return getActivationCodeFacade().findAll();
    }
    
    public User findUserPerActivationCode(String code){
        return getActivationCodeFacade().findActivationCodePerCode(code).getUser();
    }
}
